package com.ayou.eggguard.farm.mapper;

import com.ayou.eggguard.farm.pojo.ChickenShed;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface ChickenShedMapper {

    @Select("select chicken_shed.lon,chicken_shed.lat from chicken_shed")
    List<Map<String,Object>> getShedCoordinate();

    @Select("select * from chicken_shed")
    List<ChickenShed> getAllSheds();

    @Update("update chicken_shed set di_count=di_count+1 where coop_number=#{coopNumber}")
    void addDiseaseCount(String coopNumber);
}
